package model

import (
	"manager/model/entity"
)

// UserBikeSettingCreateRequest 创建现场数据
type UserBikeSettingCreateRequest struct {
	UserId int64 `json:"user_id"`

	EbikeId int64 `json:"ebike_id"`

	EbikeImage string `json:"ebike_image"`

	EbikeName string `json:"ebike_name"`

	UpdatedAt int64 `json:"updated_at"`
}

// UserBikeSettingUpdateRequest 更新现场数据
type UserBikeSettingUpdateRequest struct {
	Id int64 `json:"id"`

	UserId *int64 `json:"user_id"`

	EbikeId *int64 `json:"ebike_id"`

	EbikeImage *string `json:"ebike_image"`

	EbikeName *string `json:"ebike_name"`

	CreatedAt int64 `json:"created_at"`

	UpdatedAt *int64 `json:"updated_at"`
}

// UserBikeSettingListRequest 列表现场数据
type UserBikeSettingListRequest struct {
	Index int `json:"index"`
	Size  int `json:"size"`

	Id int64 `json:"id"`

	UserId *int64 `json:"user_id"`

	EbikeId *int64 `json:"ebike_id"`

	BikeIds []int64 `json:"bike_ids"`

	EbikeImage *string `json:"ebike_image"`

	EbikeName *string `json:"ebike_name"`

	UpdatedAt *int64 `json:"updated_at"`
}

// UserBikeSettingListResponse 列表回包数据
type UserBikeSettingListResponse struct {
	Total int                    `json:"total"`
	List  []*UserBikeSettingInfo `json:"list"`
}

// UserBikeSettingInfoRequest 列表现场数据
type UserBikeSettingInfoRequest struct {
	Id int64 `json:"id"`

	UserId *int64 `json:"user_id"`

	EbikeId *int64 `json:"ebike_id"`

	EbikeImage *string `json:"ebike_image"`

	EbikeName *string `json:"ebike_name"`

	UpdatedAt *int64 `json:"updated_at"`
}

// UserBikeSettingInfo 详细数据
type UserBikeSettingInfo struct {
	Id int64 `json:"id"`

	UserId int64 `json:"user_id"`

	EbikeId int64 `json:"ebike_id"`

	EbikeImage string `json:"ebike_image"`

	EbikeName string `json:"ebike_name"`

	CreatedAt int64 `json:"created_at"`

	UpdatedAt int64 `json:"updated_at"`
}

// UserBikeSettingDeleteRequest 删除现场数据
type UserBikeSettingDeleteRequest struct {
	Id int64 `json:"id"`
}

// UserBikeSettingsEntityToDto entity数据转换
func UserBikeSettingsEntityToDto(userBikeSettings []*entity.UserBikeSetting) []*UserBikeSettingInfo {
	out := make([]*UserBikeSettingInfo, 0, len(userBikeSettings))
	for _, c := range userBikeSettings {
		out = append(out, UserBikeSettingEntityToDto(c))
	}
	return out
}

// UserBikeSettingEntityToDto entity数据转换
func UserBikeSettingEntityToDto(e *entity.UserBikeSetting) *UserBikeSettingInfo {
	return &UserBikeSettingInfo{

		Id: e.Id,

		UserId: e.UserId,

		EbikeId: e.EbikeId,

		EbikeImage: e.EbikeImage,

		EbikeName: e.EbikeName,

		CreatedAt: e.CreatedAt,

		UpdatedAt: e.UpdatedAt,
	}
}
